﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Admin.NET.Database.Migrations.Migrations
{
    public partial class V108 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "IT_Plan_Task",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    TargetIdList = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "目标Id列表"),
                    CompleteTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false, comment: "完成时间"),
                    ImplementUserIdList = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "执行人员Id列表"),
                    Remarks = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "备注"),
                    QuestionType = table.Column<short>(type: "smallint", nullable: false, comment: "问题类型 1.路面设施设备 2.路面范围管理情况 3.养护施工秩序管理"),
                    SceneImgIdList = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "现场图片Id列表"),
                    PatrolInspection = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "巡查情况"),
                    TaskStatus = table.Column<short>(type: "smallint", nullable: false, comment: "任务状态 1.待处理 2.待审核 3.审核通过 4.审核不通过 5.完成"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_Plan_Task", x => x.Id);
                },
                comment: "计划任务表");

            migrationBuilder.CreateTable(
                name: "IT_Plan_Task_Record",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "Id主键"),
                    PlanTaskId = table.Column<long>(type: "bigint", nullable: false, comment: "计划任务Id"),
                    TaskStatus = table.Column<short>(type: "smallint", nullable: false, comment: "任务状态 1.待处理 2.待审核 3.审核通过 4.审核不通过 5.完成"),
                    Remarks = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "备注"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    CreatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建者名称"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    UpdatedUserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改者名称"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除标记")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IT_Plan_Task_Record", x => x.Id);
                },
                comment: "计划任务状态记录表");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "IT_Plan_Task");

            migrationBuilder.DropTable(
                name: "IT_Plan_Task_Record");
        }
    }
}
